package com.itheima.demoif;

import java.util.Scanner;

public class ccc {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int sum = 0;
        while (true) {
            System.out.println("是否为会员,1是 0不是");
            int a = sc.nextInt();
            if (a == 0) {
                System.out.println("您是普通顾客");
                System.out.println("请问是否充值会员 0滚 1谢谢");
                int b = sc.nextInt();
                if (b == 0) {
                    System.out.println("请输入你的折前金额");
                    int c = sc.nextInt();
                    if (c < 100 && c >= 0) {
                        System.out.println("折后金额" + c);
                        break;
                    } else if (c > 100) {
                        System.out.println("折后金额" + c * 0.9);
                        break;
                    } else {
                        System.out.println("你输入的数据有误 重新操作");
                    }
                } else if (b == 1) {
                    if(sum == 200){
                        System.out.println("您已经是会员了");
                    }else {
                        sum = 200;
                        System.out.println("返回重新操作");
                    }
                }
            } else if (a == 1) {
                System.out.println("请输入你的折前金额");
                int d = sc.nextInt();
                if (d < 200 && d >= 0) {
                    System.out.println("折后金额" + d * 0.8);
                    break;
                } else if (d > 200) {
                    System.out.println("折后金额" + d * 0.75);
                    break;
                } else {
                    System.out.println("你输入的数据有误 重新操作");
                }
            } else {
                System.out.println("你输入的数据有误 重新操作");
            }
        }

    }
}
